<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script>
    const obj = {name: 'tom', age: 10, hobby: { ball: '打球', game: '游戏' }}
    // 解构赋值
    // 自己理解：结构赋值，根据结构进行变量的声明和赋值
    // 完整写法：{ name:abc, age:age, hobby: {game: game} }
    const {name:abc,age,hobby:{game}} = obj
    // 等同
    // const abc = obj.abc
    // const age = obj.age
    // const game = obj.hobby.game
    console.log(abc,age,game)
  </script>
</body>
</html>